package com.wyx.easyExcel.easyExcelRead;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.support.ExcelTypeEnum;
import com.wyx.easyExcel.easyExcelListen.WeeklySupplyStrategyDataListener;
import com.wyx.easyExcel.easyExcelPojo.putTactics.WeeklySupplyStrategyData;

import java.io.ByteArrayInputStream;

/**
 * @author 吴宇~
 * @motto 我亦无他，唯手熟尔。
 * @edition jdk1.8
 * @reflection 0-1 喧闹任其喧闹，自由我自为之，我自风情万种，与世无争。
 * @date 2024/11/09/16:29
 * @target 心若有所向往，何惧道阻且长
 */
//每一个读和写都有对应的 获取map和获取list等的方法，是否需要进行一个归一化处理。写一个接口或者抽象类啥的。
public class WeeklySupplyStrategyRead {
    public static WeeklySupplyStrategyData process(byte[] fileByte){
        WeeklySupplyStrategyData weeklySupplyStrategyData = new WeeklySupplyStrategyData();
        EasyExcel.read(new ByteArrayInputStream(fileByte), new WeeklySupplyStrategyDataListener(weeklySupplyStrategyData))
                .excelType(ExcelTypeEnum.XLS)
                .sheet("周货源投放策略")
                .headRowNumber(0)
                .doRead();
        return weeklySupplyStrategyData;
    }
}
